package com.zhongwang.mms.module.allocation.dao;

import com.zhongwang.mms.gen.entity.AllocationOrder;
import com.zhongwang.mms.gen.entity.AllocationOrderExample;
import com.zhongwang.mms.module.allocation.model.AllocationOrderModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AllocationOrderDao {
    long countByExample(AllocationOrderExample example);

    int deleteByExample(AllocationOrderExample example);

    int deleteByPrimaryKey(Integer odrId);

    int insert(AllocationOrder record);

    int insertSelective(AllocationOrder record);

    List<AllocationOrder> selectByExample(AllocationOrderExample example);

    AllocationOrder selectByPrimaryKey(Integer odrId);

    int updateByExampleSelective(@Param("record") AllocationOrder record, @Param("example") AllocationOrderExample example);

    int updateByExample(@Param("record") AllocationOrder record, @Param("example") AllocationOrderExample example);

    int updateByPrimaryKeySelective(AllocationOrder record);

    int updateByPrimaryKey(AllocationOrder record);

    /**调拨单管理页面加载数据*/
    List<AllocationOrderModel> selectAllByQuery(AllocationOrderModel query);

    /**获取最近调拨单号*/
    String findLastMDBOrderCode();

    /**根据主键查询调拨主表*/
    AllocationOrderModel selectAllByPrimaryKey(Integer odrId);

    /**根据调拨单号修改出入库状态*/
    void updateOutStatusByOdrCode(AllocationOrder allocationOrder);

    /**调拨审核页面数据*/
    List<AllocationOrderModel> selectAllCheckByQuery(AllocationOrderModel query);
}